function http(url,callback,type){
    wx.request({
        url,
        header: {
            'Content-Type': 'json'
        },
        success: function(res) {
            callback(res,type);
        }
    })
}
function sliceTitle(title){
    if(title.length>6){
        title = title.slice(0,6)+"...";
    }
    return title;
}
function handleCasts(casts){
    var arr=[];
    casts.forEach(ele=>{
        arr.push(ele.name);
    })
    var newArr = arr.join(" ");
    return newArr;
}
function director(directors){
    if(directors){
        return directors.name
    } else {
        return "Teresa Xiao"
    }
}
export default{
    http,
    sliceTitle,
    handleCasts,
    director
}